package com.yc.springmvc.web;

import javax.servlet.*;
import javax.servlet.annotation.*;
import java.io.IOException;

@WebFilter(filterName = "LoginFilter")
public class LoginFilter implements Filter {
    public void init(FilterConfig config) throws ServletException {
    }

    public void destroy() {
    }

    @Override
    public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws ServletException, IOException {
        // 访问权限控制 => false => return
        //             => true => 必须执行 chain.doFilter => 请求到达目标资源
        chain.doFilter(request, response);
    }
}
